// eslint-disable-next-line
import { UserLayout, BasicLayout } from '@/layouts'
// BlankLayout
// import { bxAnaalyse } from '@/core/icons'

const RouteView = {
  name: 'RouteView',
  render: h => h('router-view')
}

export const asyncRouterMap = [
  {
    path: '/',
    name: 'index',
    component: BasicLayout,
    meta: { title: 'menu.home' },
    redirect: '/tenant',
    children: [
      {
        path: '/tenant',
        name: 'tenant',
        component: RouteView,
        redirect: '/tenant/manage',
        meta: { title: 'menu.tenant', icon: 'contacts', permission: ['tenant'] },
        children: [
          {
            path: '/tenant/manage',
            name: 'tenantManage',
            component: RouteView,
            redirect: '/tenant/list',
            meta: { title: 'menu.tenant', permission: ['tenant'] },
            hideChildrenInMenu: true,
            children: [
              {
                path: '/tenant/list',
                name: 'tenantList',
                component: () => import('@/views/tenant/TenantList'),
                meta: { title: 'menu.tenant.list', permission: ['tenant'] }
              },
              {
                path: '/tenant/detail',
                name: 'tenantDetail',
                component: () => import('@/views/tenant/TenantDetail'),
                meta: { title: 'menu.tenant.detail', permission: ['tenant'] }
              }
            ]
          }
        ]
      },

      {
        path: '/application',
        name: 'application',
        component: RouteView,
        redirect: '/application/list',
        meta: { title: 'menu.application', icon: 'appstore', permission: ['application'] },
        children: [
          {
            path: '/application/list',
            name: 'applicationList',
            component: () => import('@/views/application/ApplicationList'),
            meta: { title: 'menu.application.list', permission: ['application'] }
          }
        ]
      },

      {
        path: '/manager',
        name: 'manager',
        component: RouteView,
        redirect: '/manager/list',
        meta: { title: 'menu.manager', icon: 'user', permission: ['manager'] },
        children: [
          {
            path: '/manager/list',
            name: 'managerList',
            component: () => import('@/views/manager/ManagerList'),
            meta: { title: 'menu.manager.list', permission: ['manager'] }
          }
        ]
      }
    ]
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      }
    ]
  },

  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  }
]
